UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '13k1A9O6zxFamMlJ3YY3tXvH+Xk4I/OJPyNwfMqZKtM=' 
WHERE 
  key_id = '4dcb6a083baa4f548f12ab412a6ac354e2b030cfd77e1505d1ef74baf4cd214e' 
  AND (
    token = '13k1A9O6zxFamMlJ3YY3tXvH+Xk4I/OJPyNwfMqZKtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019