UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KZr6PqlIoUzhhcote8Y1C/GfVxFvXjfL5y13MPgE+Dw='
WHERE
key_id = '3e84eed7b6f0aa179c5da4d28ecb11ab487c3ebaf14572e1ef5390056d85a02b'
AND (
token = 'KZr6PqlIoUzhhcote8Y1C/GfVxFvXjfL5y13MPgE+Dw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)