UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OLECg24lwN+WyeYOCR2Zhr3z2TBQBufNGsC2CLcfFDI=' 
WHERE 
  key_id = '7f69bf0e1dff372070c0c2f0845c6c9d8de4d6fa9d9633bfb1eef459269978f7' 
  AND (
    token = 'OLECg24lwN+WyeYOCR2Zhr3z2TBQBufNGsC2CLcfFDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025