UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rStvKkAJDROngkhfMzz2+WCmpOm2nHgmuq2FyzN36Os='
WHERE
key_id = 'ff91364f76ac4606ccdef900c4cd045df90686b8946d8f53a6fab0b38dc65d54'
AND (
token = 'rStvKkAJDROngkhfMzz2+WCmpOm2nHgmuq2FyzN36Os='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)