UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MS0ZHAY6Ft/BG5V/7Bzk79+PCWFx26VxosLC+LewraQ='
WHERE
key_id = '7a36ed83833f8c81b7d1c6a7480aee8f27765203ba2c043b4e7a3cd72d136511'
AND (
token = 'MS0ZHAY6Ft/BG5V/7Bzk79+PCWFx26VxosLC+LewraQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)