UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kbNKz5YtKFvbUWHMdMf2b2uHQVz1ZZrAMuo3FBw0flM='
WHERE
key_id = '10332526cf24c9bebd39a5d5c7e0ace7e3d75d3d2e43fe1172a3cbfa3a8b0f97'
AND (
token = 'kbNKz5YtKFvbUWHMdMf2b2uHQVz1ZZrAMuo3FBw0flM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)