UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W8mLi4Oq9DqDzFWv2kpOeA+Jukqutb7pEU7NyTk1gHI='
WHERE
key_id = 'ca1dc29cd2ea74b8541b6f53a453e00acdba4f0eb7c7d80751a1c30302e53d3a'
AND (
token = 'W8mLi4Oq9DqDzFWv2kpOeA+Jukqutb7pEU7NyTk1gHI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)