UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Or9u1aAlWk7RqRYNyAvbyegEAGEK0vrYv9jhqaBB77Q='
WHERE
key_id = '821badc062fdd3109d28534a8f159a1930a460f742fed5634811d3ab72f45ec5'
AND (
token = 'Or9u1aAlWk7RqRYNyAvbyegEAGEK0vrYv9jhqaBB77Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)