UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UTU5xrppiM42iZmIuHshVpBYmrm2qC+tyoLcmQtfgnQ=' 
WHERE 
  key_id = 'a64bf59d1f01910ef64acd98fe4c712a36c53e52129bb60f8b5808f8a90c344b' 
  AND (
    token = 'UTU5xrppiM42iZmIuHshVpBYmrm2qC+tyoLcmQtfgnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038