UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Rbxq+eRyCqglQ6Y48HrBbbJ1rLyD6EEv/c5JNUW1HA='
WHERE
key_id = 'b0fb8917bc4e714f7084952c25f882fee8f1ae3fa4ffefc616d87efe82c66599'
AND (
token = '1Rbxq+eRyCqglQ6Y48HrBbbJ1rLyD6EEv/c5JNUW1HA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)