UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fO/xAr1cFptGXplsMFfmD8y/rLLmDx9vpm5/dGMELA0='
WHERE
key_id = 'e6b1255e0841abd91ec64ac42d9c666fbb1b52bd39e91c6234fed0f9835f1d78'
AND (
token = 'fO/xAr1cFptGXplsMFfmD8y/rLLmDx9vpm5/dGMELA0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)