UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rWXeLODrf2Osby+qT03yUo9UULqmZiwuEJNJvvnp1rM=' 
WHERE 
  key_id = '25cb94b9d4d550bffef0009f7c0a14bc831378fc01c0ebbaf26f476c6cb06381' 
  AND (
    token = 'rWXeLODrf2Osby+qT03yUo9UULqmZiwuEJNJvvnp1rM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022