UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '23ou9mFWKTkSOHfwYu+rgpStzZhHnm7UN470LkR4hQ8=' 
WHERE 
  key_id = '2f75d639581c97c2c913a2ea5d4162b4c17a4c859d66638c5451ec8856bb7def' 
  AND (
    token = '23ou9mFWKTkSOHfwYu+rgpStzZhHnm7UN470LkR4hQ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033