UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C6X5GVzEM6C4Y6nD2fInOc+O8s68elw1lA73/vQA5og='
WHERE
key_id = 'ea108f64477f2496cb384fb3c9a37f854c87634c503f319e828e03d567e3f9ea'
AND (
token = 'C6X5GVzEM6C4Y6nD2fInOc+O8s68elw1lA73/vQA5og='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)