UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WVISC1PCoXk7fKCPAicV+fB/+ZabzmAfBG0M/C91iOc='
WHERE
key_id = '820afa7ac3cbcdc7c4acd8c8e9f54daae0ab59a587246a320af03c8ddca44913'
AND (
token = 'WVISC1PCoXk7fKCPAicV+fB/+ZabzmAfBG0M/C91iOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)