UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S0/ArKCm0UVs9bYWmXZDzRlA5sFOLF2Eat/IjfKgOy4='
WHERE
key_id = '9b6a5b2f6dfe46ec46dbec6c5df21c55d4401d8f282961b08e9101139b244cc5'
AND (
token = 'S0/ArKCm0UVs9bYWmXZDzRlA5sFOLF2Eat/IjfKgOy4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)