UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OUFcE1F38a5yrsAEKlHYdRX8QVgtIWy7KC+AkDZsEmM=' 
WHERE 
  key_id = '89af450789bd19ff76b3263eb74f9205f1fa85ad6f4f2cc8232afdd2cb6c216a' 
  AND (
    token = 'OUFcE1F38a5yrsAEKlHYdRX8QVgtIWy7KC+AkDZsEmM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033