UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wfJo4aOmp4kYUA4++U+4rN0Z/kZQ9yYIX6wkVmQ8lxo='
WHERE
key_id = '025d969880b07b9f4487601ec8626321e207796c3b901c4f8f6c51682622262f'
AND (
token = 'wfJo4aOmp4kYUA4++U+4rN0Z/kZQ9yYIX6wkVmQ8lxo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)