UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1SMeVk0hhGgepSM57jmjmtYHKpSPsxSjJUUaak9Th8k='
WHERE
key_id = '9c854231dd24f031ce95321ad815329add375bae136f7b804d024347b2ba80f3'
AND (
token = '1SMeVk0hhGgepSM57jmjmtYHKpSPsxSjJUUaak9Th8k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)