UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hAXTZ0oBesvomyV//uu0IDrJSBNCzTe7dh8E+xqcQr0=' 
WHERE 
  key_id = '97657c5222fdf10d89c35864903f3dacb0ffbe1599e31251f04b860fffbccfb7' 
  AND (
    token = 'hAXTZ0oBesvomyV//uu0IDrJSBNCzTe7dh8E+xqcQr0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044