UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eEwP354w83u7wn/uf0+cnU2qrBkDVw2YjDLkJ91nGX4='
WHERE
key_id = '661c55a46a620c705f8ee2ae61ee5605457cfaf1111137d8d3210b17d4f832bc'
AND (
token = 'eEwP354w83u7wn/uf0+cnU2qrBkDVw2YjDLkJ91nGX4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)