UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't1Rk/gY6mspopeovQqa7GwbIf9YXir0107p0oqWxxFU='
WHERE
key_id = '1dc80784b9881b446dbc04a518fe1b73157adff1f2f8fa64cfeef8c5724f9a12'
AND (
token = 't1Rk/gY6mspopeovQqa7GwbIf9YXir0107p0oqWxxFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)