UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r/ZYjScRBSM4sn7OSpLVTxQMiFSkJuI4V2/7rkjkR4Q='
WHERE
key_id = '6c352443767f5799fa6a86d0a2132f02deb8de6e98676bd333779c06c24fe00e'
AND (
token = 'r/ZYjScRBSM4sn7OSpLVTxQMiFSkJuI4V2/7rkjkR4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)