UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'owWZ9jh8xE+9Mx0b/2R3NCNjuJeWuHQ8mTBNedc4KpQ='
WHERE
key_id = '97c3fa36e2206c26bca5540c74d41b4f56ec6c71b2a6149aeb17100855c0ce18'
AND (
token = 'owWZ9jh8xE+9Mx0b/2R3NCNjuJeWuHQ8mTBNedc4KpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)