UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ymDnOEr8Vs07nss05LGNKX2GKNFMv+VErPM9/PM4RZo=' 
WHERE 
  key_id = '8d5b3bf395a6f88ad9687a07c8059a67cdaa0a2e0d3c8beb803d457855f7bb72' 
  AND (
    token = 'ymDnOEr8Vs07nss05LGNKX2GKNFMv+VErPM9/PM4RZo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054