UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'luoZB+82Jcs3zTarVC9pEC0Vta1wtpCfgSpg3VkDcyI=' 
WHERE 
  key_id = '53152e956acb8f4b4bcf1b07c2a7aa3c5b3610bd34458685a90583bf6120975b' 
  AND (
    token = 'luoZB+82Jcs3zTarVC9pEC0Vta1wtpCfgSpg3VkDcyI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022