UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dBxoHaXkn0kWCHUL5Ox9eq8l2JiYiBGilZ2LsQxCSag='
WHERE
key_id = '66232565e9ae7a415a9c31a1443a9943fcd9f1ddbdfc254bf5d2588ca9fcf3d8'
AND (
token = 'dBxoHaXkn0kWCHUL5Ox9eq8l2JiYiBGilZ2LsQxCSag='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)