UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oqzK3Gm1rZLmB6VHvxI8j6xp+OMOFtDMfK2eA81o07E=' 
WHERE 
  key_id = '01304a7b528e6f55064737679e6dd46de86055439ae349b68c692470b6b0a18e' 
  AND (
    token = 'oqzK3Gm1rZLmB6VHvxI8j6xp+OMOFtDMfK2eA81o07E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048