UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CUGZVHNGBpYQZ0q2lgJYrvochtk33Sunf2gA6fIbTHc='
WHERE
key_id = '1c3b97775ad8bc1e0e63053841bb2c50a8db24335b8c77c3715f6a7b3ddc4269'
AND (
token = 'CUGZVHNGBpYQZ0q2lgJYrvochtk33Sunf2gA6fIbTHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)