UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p02GKEQ4/P/B+yjMH8vG0a4uv+8KzoJIiAn9yfOAztQ='
WHERE
key_id = '206e65c34d9f4a452c6064e31d5a8929d99cdfb2bdb5647029c29a21f3b26a86'
AND (
token = 'p02GKEQ4/P/B+yjMH8vG0a4uv+8KzoJIiAn9yfOAztQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)