UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GfQZOHj6kEMUQppUfoRFgpMoiwjidNToZizzn8MrXDE=' 
WHERE 
  key_id = '760a68c04a5cbe9a0b9d2918ffe5a3dd4a5c054b9a8477634b2f8b11658ce222' 
  AND (
    token = 'GfQZOHj6kEMUQppUfoRFgpMoiwjidNToZizzn8MrXDE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043