UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G8vXTzp58yL3aEnUq3BIe6aI4LPzm4pmLrqwqva5d2o=' 
WHERE 
  key_id = '089556c7321e6b8a8106ab00ae623ea7c466de513bb49e55d1ce52999870acd4' 
  AND (
    token = 'G8vXTzp58yL3aEnUq3BIe6aI4LPzm4pmLrqwqva5d2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036