UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vrjXXc5iaT6OOTdHKjMuCkDTKVUSEGVMNiDuXgUcsWA='
WHERE
key_id = 'fefca92d4cb5c2d54eeb75c316115f74510b22dacf04d310bb909ceb3db67627'
AND (
token = 'vrjXXc5iaT6OOTdHKjMuCkDTKVUSEGVMNiDuXgUcsWA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)