UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DoMN4G9QYqsdKew35L8EWh0eyJa1P41g3KjJ7KHHn8c=' 
WHERE 
  key_id = 'f5fb63ea576e10b6f162558e4e57565c0b8ad46e2d2606efe2cd040d73d5ec00' 
  AND (
    token = 'DoMN4G9QYqsdKew35L8EWh0eyJa1P41g3KjJ7KHHn8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021