UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9AnF06avtePG8Tf7izdce5QX+0UDflW746gK4SyDT/w='
WHERE
key_id = '0d48607eb24ff7adb5495a0f61abad33c9fc6b515490c36cdaa6578aa10485e8'
AND (
token = '9AnF06avtePG8Tf7izdce5QX+0UDflW746gK4SyDT/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)