UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vz1Kew/wMRuaTNaSB+ZVngdqAo75OcttvUSZZcFYStg='
WHERE
key_id = '2d33c341fb49e949d152ce4307b9f1a2177643b8afb9cd81f58fd446d234a25d'
AND (
token = 'Vz1Kew/wMRuaTNaSB+ZVngdqAo75OcttvUSZZcFYStg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)