UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/XbIAj/1x+V1YhKpWG+KC1mli+TAh/zcBalwrRcN/PY=' 
WHERE 
  key_id = '37498b3cb688aa1b560dcf207f7d82eafcdbbf4c1dcdb5c2be50295e53426fb5' 
  AND (
    token = '/XbIAj/1x+V1YhKpWG+KC1mli+TAh/zcBalwrRcN/PY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050