UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4kqfKIYplGnzOCSAYNEsuLYrdMxwD25NzfR9XO1s2Wg='
WHERE
key_id = 'a2466ec040cc4c1d2feda41efa64f5d3c5b77f217e722cb464ecd4507568bcbd'
AND (
token = '4kqfKIYplGnzOCSAYNEsuLYrdMxwD25NzfR9XO1s2Wg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)