UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'izShz5vSk6780wkgVAnp8WkM6M0AAj1H38oT1WZny7c='
WHERE
key_id = '928accc06f0632ffeebba68c17a7d913f7339ea7eb364c55bf31a6bc9539213a'
AND (
token = 'izShz5vSk6780wkgVAnp8WkM6M0AAj1H38oT1WZny7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)