UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8N3LD6JemAWubND2KeRzIayIr5bZX4a3hsSVE4efXjQ='
WHERE
key_id = '5bdd7d9bdf33bbfb860a25d78da8ca946e97f7a36a4738d3404b1b392f6da805'
AND (
token = '8N3LD6JemAWubND2KeRzIayIr5bZX4a3hsSVE4efXjQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)