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