UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zft+6ObwI/2H3x+iMdHBJk33vc2KZX52hk/bqn1tu+U='
WHERE
key_id = 'd2f4ee28e3d6f058dca9b776cf01206685d6c0bd42adc1cd4b391c4797e64b61'
AND (
token = 'Zft+6ObwI/2H3x+iMdHBJk33vc2KZX52hk/bqn1tu+U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)