UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8CR3+pkaCGYOXLQ6p4ytP8N90o8znRgkxxyU8b2k8+I=' 
WHERE 
  key_id = '847e8d9c354e4a29e9b4b565fe3b8ba1cf5741377b02a533e9a507e360fea2fc' 
  AND (
    token = '8CR3+pkaCGYOXLQ6p4ytP8N90o8znRgkxxyU8b2k8+I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045