UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NvEOMZDQElx9UKGJFDxSGJGKyrPKfNMzZ8HJRW11/Vg='
WHERE
key_id = '8af7a069722a01e9a105a04afee02206eb272b2ccfa784c0162ce6d5fc2188ff'
AND (
token = 'NvEOMZDQElx9UKGJFDxSGJGKyrPKfNMzZ8HJRW11/Vg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)