UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5ZnzKKd4+e7o2gjyCkevz6h6Yjcfoi2nQ9p92Jyxgtc='
WHERE
key_id = '70dfcc776c11d9e5566c0a73f7bf945e57fff0de4f23d32350af8517ad882cc0'
AND (
token = '5ZnzKKd4+e7o2gjyCkevz6h6Yjcfoi2nQ9p92Jyxgtc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)