UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xXzK8IYNqO1IN+5uMjUWzwv3+pwB01Pw+441mPy0elI=' 
WHERE 
  key_id = '8488e613745e296449555bd2ff1ded5e1510e8522dc2950306e53a0423f235bc' 
  AND (
    token = 'xXzK8IYNqO1IN+5uMjUWzwv3+pwB01Pw+441mPy0elI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034