UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qsf7ECK4YkeqYeOQrv/BeObHWwJah1U+vDAt/Haab68='
WHERE
key_id = '0ed55eded62273f1a3a199a55fe92675ff858d51fba613fd6240145d8005bb49'
AND (
token = 'Qsf7ECK4YkeqYeOQrv/BeObHWwJah1U+vDAt/Haab68='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)