UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '01UstDa/t+hqjG+WdGGffPkCE4Ipr6dS817lo7lxtQU='
WHERE
key_id = '6bc83cf634289d75402042941355129ad6a584e001ce687da1373260b73e1f5f'
AND (
token = '01UstDa/t+hqjG+WdGGffPkCE4Ipr6dS817lo7lxtQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)