UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JdlF6rpMAs85tw0AWkxTI6VyVdT5xqT/QXsh8rldEg8=' 
WHERE 
  key_id = '8413b1b358de499e92aeb1d713dae72f25607397b82c04b2a3cf3aef9f2bafe5' 
  AND (
    token = 'JdlF6rpMAs85tw0AWkxTI6VyVdT5xqT/QXsh8rldEg8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028