UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '65DKsxHjFFu70GUSi+Q1qFW4WHlua7A+IWPhXiCMY+s='
WHERE
key_id = 'fe90ac9efc284517d63fa720efa09083de571b6c845aba6aa65cfc1e17a97676'
AND (
token = '65DKsxHjFFu70GUSi+Q1qFW4WHlua7A+IWPhXiCMY+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)