UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8HnXsyO2tZNU4zVR/M6XszCUyiyp3K1j0gqMsJ9uFvY='
WHERE
key_id = 'd015fbb46c5403b3961f418a31e3602e960abc8b2a5793bb46e8a9356aac2721'
AND (
token = '8HnXsyO2tZNU4zVR/M6XszCUyiyp3K1j0gqMsJ9uFvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)