UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lj79yHQ7ynetgPE03t5WYJoJTqR8A3BFBS9bZcnH1RA='
WHERE
key_id = '322e74fb833e4649ae9be7d9f0287858d46eeb8932107e5a635f4baa0565c008'
AND (
token = 'Lj79yHQ7ynetgPE03t5WYJoJTqR8A3BFBS9bZcnH1RA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)